home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
130 MIDI Tool Box
/
130 MIDI Tool Box.iso
/
pc800
/
pc804.c
< prev
next >
Wrap
Text File
|
1987-10-25
|
2KB
|
78 lines
#include<dos.h>
#include<stdarg.h>
#include<stdio.h>
#include<stdlib.h>
#include"\c\colors.h"
extern int midi_x_data[5][65];
load_set()
{
int a,b;
FILE *fp;
char *fn[20];
char *fe;
screen(1); cls();
color(red+bold);
printf("\nSET LOAD");
color(blue);
printf(" - Enter Set Name:");
scanf("%s",fn);
printf("\n");
fe=".set";
strncat(fn,fe,20);
if ((fp = fopen(fn, "r"))==0) {
color(red);
printf("Bad open\n");
}
else {
for (a=0;a<5;a++)
for (b=0;b<=58;b++)
midi_x_data[a][b]=getc(fp);
fclose(fp);
color(green);
printf("Load OK\n");
}
wait_key();
screen(0);
show_midi_x_data();
}
/*------------------------------------------------------------------*/
save_set()
{
int a,b;
FILE *fp, *fopen();
char *fn[20];
char *fe;
screen(1);
color(red+bold);
printf("\nSET WRITE");
color(blue);
printf(" - Enter Set Name:");
scanf("%s",fn);
printf("\n");
fe=".set";
strncat(fn,fe,20);
if ((fp = fopen(fn, "w"))==0) {
color(red+bold);
printf("Bad open\n");
}
else {
for (a=0;a<5;a++)
for (b=0;b<=58;b++)
putc(midi_x_data[a][b],fp);
fclose(fp);
color(green+bold);
printf("Write OK\n");
}
wait_key();
screen(0);
}